package com.himilco.ocana.gui.admin;

import com.himilco.ocana.workflow.core.bo.AdminBO;
import com.himilco.ocana.workflow.core.dao.entities.Ticket;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean(name = "admin")
@SessionScoped
public class AdminIncidentViewerController {

    @EJB
    private AdminBO adminBO;
    private AdminIncidentViewerModel ivm = new AdminIncidentViewerModel();

    public List<Ticket> getIncidents() {
        ivm.setTickets(adminBO.findAllIncidents());
        return ivm.getTickets();
    }

    public AdminIncidentViewerModel getIvm() {
        return ivm;
    }

    public void setIvm(AdminIncidentViewerModel ivm) {
        this.ivm = ivm;
    }

    public AdminBO getAdminBO() {
        return adminBO;
    }
}
